package com.ccp.dev.workflow.bpmimpl.skipimpl;

import com.ccp.dev.core.basic.util.ContextUtil;
import com.ccp.dev.system.model.SysUser;
import com.ccp.dev.workflow.bpminterface.ISkipCondition;
import org.flowable.task.api.Task;

/**
 * 相同执行人跳过。
 * @author jiayueqiao
 */
public class SameUserSkipCondition implements ISkipCondition {

	@Override
	public boolean canSkip(Task task) {
		SysUser sysUser=(SysUser) ContextUtil.getCurrentUser();
		String assignee=task.getAssignee();
		String curUserId=sysUser.getUserId();
		return curUserId.equals(assignee);
	}

	@Override
	public String getTitle() {
		return "相同执行人跳过";
	}

}
